home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Leser 15 / Amiga Plus Leser CD 15.iso / Tools / Development / MosaicSRC / src / C_C_v38.sd < prev    next >
Encoding:
Text File  |  2002-03-13  |  1.4 KB  |  70 lines

  1. ##stringtype C
  2. ##shortstrings
  3. /****************************************************************
  4.    This file was created automatically by `FlexCat V1.0'
  5.    Do NOT edit by hand!
  6. ****************************************************************/
  7.  
  8. #include "%b_cat.h"
  9. #include <proto/locale.h>
  10.  
  11. static LONG %b_Version = %v;
  12. static const STRPTR %b_BuiltInLanguage = (STRPTR) %l;
  13.  
  14. struct FC_Type
  15. {   LONG   ID;
  16.     STRPTR Str;
  17. };
  18.  
  19.  
  20. static const struct FC_Type %b_Array [] =
  21. {
  22.     %i, (STRPTR) %s,
  23. };
  24.  
  25.  
  26. static struct Catalog *%b_Catalog = NULL;
  27.  
  28. void Open%bCatalog(struct Locale *loc, STRPTR language)
  29. { LONG tag, tagarg;
  30.   extern struct Library *LocaleBase;
  31.  
  32.   if (language == NULL)
  33.   { tag = TAG_IGNORE;
  34.   }
  35.   else
  36.   { tag = OC_Language;
  37.     tagarg = (LONG) language;
  38.   }
  39.   if (LocaleBase != NULL  &&  %b_Catalog == NULL)
  40.   { %b_Catalog = OpenCatalog(loc, (STRPTR) "%b.catalog",
  41.                  OC_BuiltInLanguage, %b_BuiltInLanguage,
  42.                  tag, tagarg,
  43.                  OC_Version, %b_Version,
  44.                  TAG_DONE);
  45.   }
  46. }
  47.  
  48. void Close%bCatalog(void)
  49. { if (LocaleBase != NULL)
  50.   { CloseCatalog(%b_Catalog);
  51.   }
  52.   %b_Catalog = NULL;
  53. }
  54.  
  55. STRPTR Get%bString(LONG strnum)
  56. { STRPTR defaultstr = NULL;
  57.   LONG i;
  58.  
  59.   for (i = 0;  i < sizeof(%b_Array)/sizeof(struct FC_Type);  i++)
  60.     { if (%b_Array[i].ID == strnum)
  61.       { defaultstr = %b_Array[i].Str;
  62.     break;
  63.       }
  64.     }
  65.   if (%b_Catalog == NULL)
  66.   { return(defaultstr);
  67.   }
  68.   return(GetCatalogStr(%b_Catalog, strnum, defaultstr));
  69. }
  70.